<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1" import="ass.beans.*" import="ass.dao.*"
	import="ass.dao.support.*" import="java.util.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
	<%@ include file="header.html"%>
	<%@ include file="userNavBar.html"%>
	<%
		List<UserFriendsBean> userFriendsList = (List<UserFriendsBean>) request
				.getAttribute("userFriendsList");
	%>
	<div align="center">
		<form name="form1" method="post" action="">
			<table width="400" border="0">




				<%
					if (userFriendsList.size() == 0) {
						out.print("<tr>");
						out.print("<td>No friend at the moment!</td>");
						out.print("</tr>");
					} else {
						out.print("<tr><th  align='left'>Friend</th><th  align='left'>Friend Detail</th><th  align='left'>Action</th></tr>");
						for (UserFriendsBean userFrdBean : userFriendsList) {
							// out.print("<tr>");
							// out.print("  <td>"+ userFrdBean.getUsername() +"</td>");
							//
							//out.print("  <td>"+ userFrdBean.getMessage() +"</td>");
							// out.print("  <td><input type='submit' value='Accept'></td>");	
							// out.print("  <td><input type='submit' value='Reject'></td>");	  
							// out.print("</tr>");
							

							out.print("<tr>");
							//out.print("  <td align='center'>username:"
							//		+ session.getAttribute("username") + "</td>");
							if(session.getAttribute("username").equals(userFrdBean.getUsername())){
								out.print("  <td align='left'>"
										+ userFrdBean.getUsernameFriend() + "</td>");
								out.print("  <td align='left'><a href='userFrdSearchDetail.jsp?username="
										+ userFrdBean.getUsernameFriend()
										+ "'>Show Detail</a></td>");
								out.print("  <td align='left'><a href='DeleteFriend?friendname="
										+ userFrdBean.getUsernameFriend()
										+ "'>Delete</a></td>");
							}else{
								out.print("  <td align='left'>"
										+ userFrdBean.getUsername() + "</td>");
								out.print("  <td align='left'><a href='userFrdSearchDetail.jsp?username="
										+ userFrdBean.getUsername()
										+ "'>Show Detail</a></td>");
								out.print("  <td align='left'><a href='DeleteFriend?friendname="
										+ userFrdBean.getUsername()
										+ "'>Delete</a></td>");
							}

							


							out.print("</tr>");
						}
					}
				%>



			</table>





		</form>
	</div>
</body>
</html>